public class Lab14Task03 {
	public static void main(String[] args) {
		char[] correctAnswers = { 'T', 'T', 'F', 'F', 'T' };
		char[][] studentsAnswers = { { 'T', 'F', 'T', 'T', 'T' }, { 'T', 'T', 'T', 'T', 'T' },
				{ 'T', 'T', 'F', 'F', 'T' }, { 'F', 'T', 'F', 'F', 'F' }, { 'F', 'F', 'F', 'F', 'F' },
				{ 'F', 'T', 'T', 'T', 'F' } };
		int[] grades = getGrades(correctAnswers, studentsAnswers);
		System.out.println("#Student\tGrade out of 25");
		for (int i = 0; i < 6; i++) {
			System.out.printf("%7d\t%14d\n", i + 1, grades[i] * 5);
		}
	}

	private static int[] getGrades(char[] correctAnswers, char[][] studentsAnswers) {
		int[] gradesOfStudents = new int[5];
		for (int row = 0; row < 6; row++) {
			for (int column = 0; column < 5; column++) {
				if (studentsAnswers[row][column] == correctAnswers[column]) {
					gradesOfStudents[row]++;
				}
			}
		}
		return gradesOfStudents;
	}
}